<?php

/*
Process Points Script (admin_points.pro.php)
*/

$rank_check = "7";
include "../global.inc.php";

$points_username = strtolower(ereg_replace(" ", "", $points_username));
$findUsername = fetch("SELECT * FROM members2 WHERE username = '$points_username' AND game = '$game'");

if ($points_value < 0) { $points_value = 0; }

if ($give_take == "give") { $newPoints = $findUsername[points] + $points_value; $words = "given $points_value $pointsVar to"; }

if ($give_take == "take") { $newPoints = $findUsername[points] - $points_value; $words = "taken $points_value $pointsVar from"; }

mysql_query("UPDATE members2 SET points=$newPoints WHERE username = '$points_username' AND game = '$game'");

$errorMessage = "You+have+$words+$findUsername[display_name],+they+went+from+$findUsername[points]+to+$newPoints.";

systemmessage("$game", "", "$findUsername[id]", "An admin has $words you!");

header("Location: admin_points.php?game=$game&error=$errorMessage");

?>
